#include "cmdline.h"

int main(int argc, char *argv[])
{
    // 创建一个命令行解析器;
    cmdline::parser cmd;
    // 加入指定类型的输入参数  长名称，短名称(\0表示没短名)，参数描写叙述，是否必须传值(bool值)，参数默认值;
    cmd.add<std::string>("model_path", 'm', "Path to onnx model.", false, "../models/yolov5s.onnx");
    cmd.add<std::string>("image", 'i', "Image source to be detected.", false, "../images");
    cmd.add<std::string>("class_names", 'c', "Path to class names file.", false, "../models/coco.names");
    cmd.add<int>("device", '\0', "cuda device, -0--gpu  or -1--cpu", false, 0);

    // 传入命令行，进行分析，不符合时输出信息，退出程序;
    cmd.parse_check(argc, argv);

    int device = cmd.get<int>("device");
    bool isGPU = device >= 0;
    const std::string classNamesPath = cmd.get<std::string>("class_names");
    const std::string imagePath = cmd.get<std::string>("image");
    const std::string modelPath = cmd.get<std::string>("model_path");

    std::cout << classNamesPath << std::endl;

    return 0;
}

// yolo_onnxruntime.exe --model_path=../models/yolov5s.onnx --image=../images --class_names=../models/coco.names